\hypertarget{class_logger}{\section{Logger类 参考}
\label{class_logger}\index{Logger@{Logger}}
}


日志类,用于记录重要信息到文件系统中  




{\ttfamily \#include $<$Logger.\+h$>$}

\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
sint32 \hyperlink{class_logger_a3bb2e96a5399ecfb948394f1a1a84757}{init} (std\+::string dir, std\+::string log\+File\+Pref=\char`\"{}log\char`\"{})
\begin{DoxyCompactList}\small\item\em 初始化日志 \end{DoxyCompactList}\item 
void \hyperlink{class_logger_a4e63cbc1d6d8f374afe1d3e12b5f5842}{log} (const char $\ast$fmt,...)
\begin{DoxyCompactList}\small\item\em 记录日志 \end{DoxyCompactList}\item 
void \hyperlink{class_logger_aee38897c7bb4cd9fe325fa7c07678d15}{close\+Log} ()
\begin{DoxyCompactList}\small\item\em 关闭日志 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{静态 Public 成员函数}
\begin{DoxyCompactItemize}
\item 
static \hyperlink{class_logger}{Logger} $\ast$ \hyperlink{class_logger_a9ddfac0640ed92ac153f7e24f6134bcb}{get\+Instance} ()
\begin{DoxyCompactList}\small\item\em 获取\+Logger单例 \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{详细描述}
日志类,用于记录重要信息到文件系统中 

\begin{DoxyNote}{注解}
注意\+:记录日志由于要读写文件，速度会比较慢， 请不要记录无用信息,尽量只记录重要信息!!! 
\end{DoxyNote}


\subsection{成员函数说明}
\hypertarget{class_logger_aee38897c7bb4cd9fe325fa7c07678d15}{\index{Logger@{Logger}!close\+Log@{close\+Log}}
\index{close\+Log@{close\+Log}!Logger@{Logger}}
\subsubsection[{close\+Log}]{\setlength{\rightskip}{0pt plus 5cm}void Logger\+::close\+Log (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_logger_aee38897c7bb4cd9fe325fa7c07678d15}


关闭日志 


\begin{DoxyParams}{参数}
{\em void} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
void 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_logger_a9ddfac0640ed92ac153f7e24f6134bcb}{\index{Logger@{Logger}!get\+Instance@{get\+Instance}}
\index{get\+Instance@{get\+Instance}!Logger@{Logger}}
\subsubsection[{get\+Instance}]{\setlength{\rightskip}{0pt plus 5cm}static {\bf Logger}$\ast$ Logger\+::get\+Instance (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{class_logger_a9ddfac0640ed92ac153f7e24f6134bcb}


获取\+Logger单例 


\begin{DoxyParams}{参数}
{\em void} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
Logger$\ast$ 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_logger_a3bb2e96a5399ecfb948394f1a1a84757}{\index{Logger@{Logger}!init@{init}}
\index{init@{init}!Logger@{Logger}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Logger\+::init (
\begin{DoxyParamCaption}
\item[{std\+::string}]{dir, }
\item[{std\+::string}]{log\+File\+Pref = {\ttfamily \char`\"{}log\char`\"{}}}
\end{DoxyParamCaption}
)}}\label{class_logger_a3bb2e96a5399ecfb948394f1a1a84757}


初始化日志 


\begin{DoxyParams}{参数}
{\em dir} & 指定日志文件保存目录 \\
\hline
{\em log\+File\+Pref} & 指定日志文件名前缀 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
每调用一次将产生一个log文件,文件名自动添加时间后缀,日志文件名格 式如log\+File\+\_\+20130101235959,创建时间为2013-\/01-\/01 23\+:59\+:59 
\end{DoxyNote}
\hypertarget{class_logger_a4e63cbc1d6d8f374afe1d3e12b5f5842}{\index{Logger@{Logger}!log@{log}}
\index{log@{log}!Logger@{Logger}}
\subsubsection[{log}]{\setlength{\rightskip}{0pt plus 5cm}void Logger\+::log (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{format, }
\item[{}]{...}
\end{DoxyParamCaption}
)}}\label{class_logger_a4e63cbc1d6d8f374afe1d3e12b5f5842}


记录日志 


\begin{DoxyParams}{参数}
{\em format} & 格式化字串 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
void 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
libemb/inc/\hyperlink{_logger_8h}{Logger.\+h}\item 
libemb/src/Logger.\+cpp\end{DoxyCompactItemize}
